package com.lanmaoly.study.controller;

import com.lanmaoly.study.service.UserService;
import com.lanmaoly.study.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by chao.xia on 2018/1/7 14:46
 */
@Controller
public class IndexController {

    @Autowired
    private UserService userService;


    /**
     * 删除用户
     */
    @ResponseBody
    @RequestMapping("delete")
    public String delete(String name) {
        userService.delete(name);
        return "success";
    }

    @RequestMapping("index")
    public String index() {
        return "index";
    }

}
